package Create_Our_Own_Array;

/**
 * @author wly
 * @version V1.0.0
 * @date 2023/2/26 20:27
 */
public class Main {
    public static void main(String[] args) {
        Array<Integer> arr = new Array<>(10);
        for (int i = 0; i < 10; i++) {
            arr.addLast(i + 1);
        }
        System.out.println(arr);

        arr.add(1, 99);
        System.out.println(arr);

        arr.addFirst(-1);
        System.out.println(arr);

        arr.remove(2);
        System.out.println(arr);

        arr.removeElement(4);
        System.out.println(arr);

        arr.removeFirst();
        System.out.println(arr);

        Array<Student> stus = new Array<>();
        stus.addLast(new Student("Alice", 100));
        stus.addLast(new Student("Bob", 66));
        stus.addLast(new Student("Charlie", 88));
        stus.addLast(new Student("Charlie", 88));
        System.out.println(stus);
    }
}
